#ifndef __WIN32MESSAGEMAP_H__
#define __WIN32MESSAGEMAP_H__

class CWin32Window;

typedef void (CWin32Window::*PMSG)(void);

struct MSGMAP_ENTRY {
	unsigned int nMessage;
	unsigned int nCode;
	unsigned int nID;
	unsigned int nLastID;
	unsigned int nSig;
	PMSG pfn;
};

struct MSGMAP {
	MSGMAP* pBaseMessageMap;
	MSGMAP_ENTRY* lpEntries;
};

#define DECLARE_MESSAGE_MAP() \
	static MSGMAP_ENTRY _messageEntries[]; \
	static MSGMAP messageMap; \
	virtual MSGMAP* GetMessageMap() const;

#define BEGIN_MESSAGE_MAP( theClass, baseClass ) \
	MSGMAP* theClass::GetMessageMap() const \
		{ return &theClass::messageMap; } \
	MSGMAP theClass::messageMap = \
		{ &baseClass::messageMap, (MSGMAP_ENTRY*)&(theClass::_messageEntries[0]) }; \
	MSGMAP_ENTRY theClass::_messageEntries[] = \
	{

#define ON_COMMAND( id, memberFun )
	{ WM_COMMAND, 0, (WORD)id, (WORD)id, 1, (PMSG)memberFun }, 

#define END_MESSAGE_MAP()
	{ 0, 0, 0, 0, 0, (PMSG)0 } \
	};



#endif	//	__WIN32MESSAGEMAP_H__